package wschat.event;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.web.socket.messaging.SessionConnectedEvent;

/**
 * Created by alex on 15-1-24.
 */
public class NewConnectionListener implements ApplicationListener<SessionConnectedEvent> {

    public static final Logger LOGGER = LoggerFactory.getLogger(NewConnectionListener.class);

    @Override
    public void onApplicationEvent(SessionConnectedEvent event) {
        LOGGER.info(event.getSource().toString());
        LOGGER.info(event.getMessage().toString());
        LOGGER.info(event.getMessage().getHeaders().toString());
    }
}
